﻿using System;
using System.ComponentModel.Design;
using Microsoft.VisualStudio.Shell;

namespace Red.Scripts.Options.Tool.Bar.Extensions
{
    public static class OleMenuCommandServiceExtensions
    {
        public static void InitializeButton( this OleMenuCommandService commandService, Guid guid, int id, EventHandler handler )
        {
            CommandID toolbarButtonId = new CommandID( guid, id );
            OleMenuCommand toolbarButtonCommand = new OleMenuCommand( handler, toolbarButtonId );
            commandService.AddCommand( toolbarButtonCommand );
        }
    }
}
